1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * @addtogroup NativeActivity Native Activity 19 * @{ 20 */ 21 22 /** 23 * @file window.h 24 */ 25 26 module android.ndk.window; 27 28 import arsd.jni; 29 import android.ndk; 30 31 extern (C): 32 nothrow: 33 @nogc: 34 35 /** 36 * Window flags, as per the Java API at android.view.WindowManager.LayoutParams. 37 */ 38 enum 39 { 40 /** 41 * As long as this window is visible to the user, allow the lock 42 * screen to activate while the screen is on. This can be used 43 * independently, or in combination with {@link 44 * AWINDOW_FLAG_KEEP_SCREEN_ON} and/or {@link 45 * AWINDOW_FLAG_SHOW_WHEN_LOCKED} 46 */ 47 AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001, 48 /** Everything behind this window will be dimmed. */ 49 AWINDOW_FLAG_DIM_BEHIND = 0x00000002, 50 /** 51 * Blur everything behind this window. 52 * @deprecated Blurring is no longer supported. 53 */ 54 AWINDOW_FLAG_BLUR_BEHIND = 0x00000004, 55 /** 56 * This window won't ever get key input focus, so the 57 * user can not send key or other button events to it. Those will 58 * instead go to whatever focusable window is behind it. This flag 59 * will also enable {@link AWINDOW_FLAG_NOT_TOUCH_MODAL} whether or not that 60 * is explicitly set. 61 * 62 * Setting this flag also implies that the window will not need to 63 * interact with 64 * a soft input method, so it will be Z-ordered and positioned 65 * independently of any active input method (typically this means it 66 * gets Z-ordered on top of the input method, so it can use the full 67 * screen for its content and cover the input method if needed. You 68 * can use {@link AWINDOW_FLAG_ALT_FOCUSABLE_IM} to modify this behavior. 69 */ 70 AWINDOW_FLAG_NOT_FOCUSABLE = 0x00000008, 71 /** this window can never receive touch events. */ 72 AWINDOW_FLAG_NOT_TOUCHABLE = 0x00000010, 73 /** 74 * Even when this window is focusable (its 75 * {@link AWINDOW_FLAG_NOT_FOCUSABLE} is not set), allow any pointer events 76 * outside of the window to be sent to the windows behind it. Otherwise 77 * it will consume all pointer events itself, regardless of whether they 78 * are inside of the window. 79 */ 80 AWINDOW_FLAG_NOT_TOUCH_MODAL = 0x00000020, 81 /** 82 * When set, if the device is asleep when the touch 83 * screen is pressed, you will receive this first touch event. Usually 84 * the first touch event is consumed by the system since the user can 85 * not see what they are pressing on. 86 * 87 * @deprecated This flag has no effect. 88 */ 89 AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040, 90 /** 91 * As long as this window is visible to the user, keep 92 * the device's screen turned on and bright. 93 */ 94 AWINDOW_FLAG_KEEP_SCREEN_ON = 0x00000080, 95 /** 96 * Place the window within the entire screen, ignoring 97 * decorations around the border (such as the status bar). The 98 * window must correctly position its contents to take the screen 99 * decoration into account. 100 */ 101 AWINDOW_FLAG_LAYOUT_IN_SCREEN = 0x00000100, 102 /** allow window to extend outside of the screen. */ 103 AWINDOW_FLAG_LAYOUT_NO_LIMITS = 0x00000200, 104 /** 105 * Hide all screen decorations (such as the status 106 * bar) while this window is displayed. This allows the window to 107 * use the entire display space for itself -- the status bar will 108 * be hidden when an app window with this flag set is on the top 109 * layer. A fullscreen window will ignore a value of {@link 110 * AWINDOW_SOFT_INPUT_ADJUST_RESIZE}; the window will stay 111 * fullscreen and will not resize. 112 */ 113 AWINDOW_FLAG_FULLSCREEN = 0x00000400, 114 /** 115 * Override {@link AWINDOW_FLAG_FULLSCREEN} and force the 116 * screen decorations (such as the status bar) to be shown. 117 */ 118 AWINDOW_FLAG_FORCE_NOT_FULLSCREEN = 0x00000800, 119 /** 120 * Turn on dithering when compositing this window to 121 * the screen. 122 * @deprecated This flag is no longer used. 123 */ 124 AWINDOW_FLAG_DITHER = 0x00001000, 125 /** 126 * Treat the content of the window as secure, preventing 127 * it from appearing in screenshots or from being viewed on non-secure 128 * displays. 129 */ 130 AWINDOW_FLAG_SECURE = 0x00002000, 131 /** 132 * A special mode where the layout parameters are used 133 * to perform scaling of the surface when it is composited to the 134 * screen. 135 */ 136 AWINDOW_FLAG_SCALED = 0x00004000, 137 /** 138 * Intended for windows that will often be used when the user is 139 * holding the screen against their face, it will aggressively 140 * filter the event stream to prevent unintended presses in this 141 * situation that may not be desired for a particular window, when 142 * such an event stream is detected, the application will receive 143 * a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so 144 * applications can handle this accordingly by taking no action on 145 * the event until the finger is released. 146 */ 147 AWINDOW_FLAG_IGNORE_CHEEK_PRESSES = 0x00008000, 148 /** 149 * A special option only for use in combination with 150 * {@link AWINDOW_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the 151 * screen your window may appear on top of or behind screen decorations 152 * such as the status bar. By also including this flag, the window 153 * manager will report the inset rectangle needed to ensure your 154 * content is not covered by screen decorations. 155 */ 156 AWINDOW_FLAG_LAYOUT_INSET_DECOR = 0x00010000, 157 /** 158 * Invert the state of {@link AWINDOW_FLAG_NOT_FOCUSABLE} with 159 * respect to how this window interacts with the current method. 160 * That is, if FLAG_NOT_FOCUSABLE is set and this flag is set, 161 * then the window will behave as if it needs to interact with the 162 * input method and thus be placed behind/away from it; if {@link 163 * AWINDOW_FLAG_NOT_FOCUSABLE} is not set and this flag is set, 164 * then the window will behave as if it doesn't need to interact 165 * with the input method and can be placed to use more space and 166 * cover the input method. 167 */ 168 AWINDOW_FLAG_ALT_FOCUSABLE_IM = 0x00020000, 169 /** 170 * If you have set {@link AWINDOW_FLAG_NOT_TOUCH_MODAL}, you 171 * can set this flag to receive a single special MotionEvent with 172 * the action 173 * {@link AMOTION_EVENT_ACTION_OUTSIDE} for 174 * touches that occur outside of your window. Note that you will not 175 * receive the full down/move/up gesture, only the location of the 176 * first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}. 177 */ 178 AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000, 179 /** 180 * Special flag to let windows be shown when the screen 181 * is locked. This will let application windows take precedence over 182 * key guard or any other lock screens. Can be used with 183 * {@link AWINDOW_FLAG_KEEP_SCREEN_ON} to turn screen on and display windows 184 * directly before showing the key guard window. Can be used with 185 * {@link AWINDOW_FLAG_DISMISS_KEYGUARD} to automatically fully dismisss 186 * non-secure keyguards. This flag only applies to the top-most 187 * full-screen window. 188 */ 189 AWINDOW_FLAG_SHOW_WHEN_LOCKED = 0x00080000, 190 /** 191 * Ask that the system wallpaper be shown behind 192 * your window. The window surface must be translucent to be able 193 * to actually see the wallpaper behind it; this flag just ensures 194 * that the wallpaper surface will be there if this window actually 195 * has translucent regions. 196 */ 197 AWINDOW_FLAG_SHOW_WALLPAPER = 0x00100000, 198 /** 199 * When set as a window is being added or made 200 * visible, once the window has been shown then the system will 201 * poke the power manager's user activity (as if the user had woken 202 * up the device) to turn the screen on. 203 */ 204 AWINDOW_FLAG_TURN_SCREEN_ON = 0x00200000, 205 /** 206 * When set the window will cause the keyguard to 207 * be dismissed, only if it is not a secure lock keyguard. Because such 208 * a keyguard is not needed for security, it will never re-appear if 209 * the user navigates to another window (in contrast to 210 * {@link AWINDOW_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily 211 * hide both secure and non-secure keyguards but ensure they reappear 212 * when the user moves to another UI that doesn't hide them). 213 * If the keyguard is currently active and is secure (requires an 214 * unlock pattern) than the user will still need to confirm it before 215 * seeing this window, unless {@link AWINDOW_FLAG_SHOW_WHEN_LOCKED} has 216 * also been set. 217 */ 218 AWINDOW_FLAG_DISMISS_KEYGUARD = 0x00400000 219 } 220 221 // ANDROID_WINDOW_H 222 223 /** @} */